﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;

namespace WinHBM.Utils
{
    public class UtilPing
    {
        private static readonly log4net.ILog Logger = log4net.LogManager.GetLogger(typeof(UtilPing));
        public static bool ping(string address)
        {
            try
            {
                Ping ping = new Ping();
                PingReply reply = ping.Send(address);
                return reply.Status == IPStatus.Success;
            }
            catch (Exception)
            {
                Logger.Error("网路连接异常");
                return false;
            }
            
        }


    }
}
